<?php
class My_EventUserController extends MM_Controller_My_Action
{	
	//查看活动来宾,关注人数	
	/**
	 * 初始化
	 */
	public function init()
	{
		parent::init();	
	}
	
	/**
	 * index
	 */
	public function indexAction()
	{		
		$this->helper->setPageView($this->pageview, WEB_TITLE, "eventuser", null);
	}

	public function getAction(){
		if ( $this->eid<1 ) {
			$this->result = $this->returnResult(Mediad2_Model_Result::CODE_FAILURE,'Miss parameter: eid');
		} else {
			$event = new MM_Service_Admin_Event();
	
			$where = sprintf("eid = '%s'",$this->eid);
	
			$r1 = $event->find($this->eid,true);
			//$r2 = $user->fetchAll(1,999,$where,null,true);
			//$r3 = $follow->fetchAll(1,999,$where,null,true);
	
			$mapper = $event->getMapper();
			$userSQL = sprintf("select * from event_user_detail where eid = '%s' ORDER BY addtime desc",$this->eid);
			$r2 = $mapper->__querySQL($userSQL);
			
			$followSQL = sprintf("select * from event_follower_detail where eid = '%s' ORDER BY addtime desc",$this->eid);
			$r3 = $mapper->__querySQL($followSQL);
			
			$data['event'] = $r1->getData();
			$data['user'] = $r2;
			$data['follow'] = $r3;
			$this->returnResult(1,"all",$data);
		}
		echo $this->encodeResult($this->result);
	
	}
}